package demo;
//Day4
public class Day14004 {
    public static void main(String[] args) {
        invokeCalc("张三", 18, new Calculator() {
            @Override
            public int calc(int a, int b) {
                return a-b;
            }
        });
    }
    private static void invokeCalc(String name, int age, Calculator calculator) {
        int result = calculator.calc(130, 120);
        System.out.println(age + "岁的" + name + "计算结果是：" + result);
    }
}

interface Calculator{
    int calc(int a,int b);
}

